package com.elesyser.util;

import android.text.format.Time;

public class Date {
	private static String semestor;
	private static String academicYear;
	private static int Today;
	private static Integer year;
	private static Integer month;
	private static Integer day;

	/**
	 * @return the year
	 */
	public static Integer getYear() {
		return year;
	}

	/**
	 * @param year the year to set
	 */
	public static void setYear(Integer year) {
		Date.year = year;
	}

	/**
	 * @return the month
	 */
	public static Integer getMonth() {
		return month;
	}

	/**
	 * @param month the month to set
	 */
	public static void setMonth(Integer month) {
		Date.month = month;
	}

	public Date(){
		Time time = new Time();
    	time.setToNow();
    	year = time.year;
    	month = time.month;
    	
    	setSemestor("");
    	setAcademicYear("");
    	if(month < 9){
    		setAcademicYear(Integer.toString(year-1) +"-" +year.toString());
    	}
    	else{
    		setAcademicYear(year.toString() + "-" + Integer.toString(year + 1));
    	}
    	
    	if(month <2 || month >= 9){
    		setSemestor("1");
    	}
    	else {
			setSemestor("2");
		}
    	setToday(time.weekDay == 0 ? 7 : time.weekDay) ;
    	setDay(time.monthDay);
	}

	public  void setSemestor(String semestor) {
		this.semestor = semestor;
	}

	public String getSemestor() {
		return semestor;
	}

	public void setAcademicYear(String academicYear) {
		this.academicYear = academicYear;
	}

	public static String getAcademicYear() {
		return academicYear;
	}

	public static void setToday(int today) {
		Today = today;
	}

	public static int getToday() {
		return Today;
	}

	/**
	 * @param day the day to set
	 */
	public static void setDay(Integer day) {
		Date.day = day;
	}

	/**
	 * @return the day
	 */
	public static Integer getDay() {
		return day;
	}
}
